 <?php
	print("<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?> \n");
	print("<Result>\n");
	if(!isset($_GET["discription"]) || !isset($_GET["DID"]) || !isset($_GET["type"]))
	{
		print("</Result>\n");
		return;
	}
	$db = mysql_connect("localhost","root","root");
    mysql_select_db("brainway");
	
	$query = "select * from datasource_discription where DID=".$_GET["DID"];
	$result = mysql_query($query);
	if(mysql_num_rows($result) == 0)
	{
        $query = "insert into datasource_discription values(".$_GET["DID"].",\"".$_GET["discription"]."\")";
	}
	else
	{
        $query = "update datasource_discription set discription=\"".$_GET["discription"]."\" where DID=".$_GET["DID"];
    }

    $result = mysql_query($query);
    if($result==null)  
    {
        print("</Result>\n");
		return;
    }

    print(" <ID>".$_GET["DID"]."</ID> \n");
    print(" <discription>".$_GET["discription"]."</discription> \n");
    print(" <type>".$_GET["type"]."</type> \n");
    print("</Result>");
?>